/**
 * Copyright &copy; 2012-2016 <a href="https://github.com.chuangyuan.base">JeeSite</a> All rights reserved.
 */
package com.xyp.cityipgen.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.Length;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import java.util.Date;


/**
 * 数据Entity类
 * @author ThinkGem
 * @version 2014-05-16
 */
@XmlRootElement
public abstract class DataEntity<T> extends BaseEntity<T> {

	private static final long serialVersionUID = 1L;
	
	protected String remarks;	// 备注
	protected User createBy;	// 创建者
	protected Date createDate;	// 创建日期
	protected User updateBy;	// 更新者
	protected Date updateDate;	// 更新日期
	protected String delFlag; 	// 删除标记（0：正常；1：删除；2：审核）
	protected String status; 	//逻辑上的状态 1:正常，0审核，-1删除
	protected String tenantid; // 租户id  这里我们规定 为1的是 共有的
	@XmlElement
	public String token;
	protected User currentClientUser;

	public DataEntity() {
		super();
		this.status="1";
	}
	


	public void setCurrentClientUser(User currentClientUser) {
		this.currentClientUser = currentClientUser;
	}

	public void setToken(String token) {
		this.token = token;
	}

	@XmlTransient
	public String getToken() {
		return token;
	}


	public void setTenantid(String tenantid) {
		this.tenantid = tenantid;
	}

	public String getTenantid() {
		return tenantid;
	}

	@Length(min=0, max=255)
	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	
	@JsonIgnore
	public User getCreateBy() {
		return createBy;
	}

	public void setCreateBy(User createBy) {
		this.createBy = createBy;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@JsonIgnore
	public User getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(User updateBy) {
		this.updateBy = updateBy;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@JsonIgnore
	@Length(min=1, max=1)
	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	@JsonIgnore
	public String getStatus() {
		return status;
	}
}
